package com.yesep.learn.design.behavioral.interpreter.calculator;

public class VariableExpression implements IExpression {
    private final String variableName;

    public VariableExpression(String variableName) {
        this.variableName = variableName;
    }

    @Override
    public double interpret(Context context) {
        return context.getVariable(variableName);
    }
}